function isNumeric(data){
	if(data.length==0)return true;
	if(data.indexOf('+',0)>-1 || data.indexOf('-',0)>-1 )
		return false;
	
	if(isValidText(data)){
		if(isNaN(data)){
			return false;
		}
		else{
			return true;
		}
	}
	else{
		return false;
	}
}

function isValidText(data){
	
	data = trim(data);
	if(data!=''){
		return true; 
	}
	else{
		return false;
	}
}


//left trim
function ltrim ( str ) 
{ 
	//return str.replace( /^\s+/, '' ) 
	
	while (str.charAt(0) == ' ')
    	str = str.substring(1);
    	return str;
} 


//--------------------------------------------------------------------------------------------------------------------

//right trim
function rtrim ( str ) 
{ 
	//return str.replace( /\s+$/, '' ); 
	
	while (str.charAt(str.length - 1) == ' ')
 	str = str.substring(0, str.length - 1);
  	return str;
}


//--------------------------------------------------------------------------------------------------------------------

//Combine the rtrim() and ltrim() functions to make the trim() 
//function, which just wraps both calls together: 
function trim ( str ) 
{ 
	return rtrim(ltrim(str)); 
} 



//--------------------------------------------------------------------------------------------------------------------

//returns month of the date
function getmonth(date){
	if(date.indexOf('-')!=-1)
		return date.substring(date.indexOf('-')+1,date.lastIndexOf('-')); 
	else
		return date.substring(date.indexOf('/')+1,date.lastIndexOf('/')); 
}


//--------------------------------------------------------------------------------------------------------------------

//returns date of the date
function getdate(date){
	if(date.indexOf('-')!=-1)
		return date.substring(0,date.indexOf('-')); 
	else
		return date.substring(0,date.indexOf('/')); 
}


//--------------------------------------------------------------------------------------------------------------------

//returns year of the date
function getyear(date){
	if(date.indexOf('-')!=-1)
		return date.substring(date.lastIndexOf('-')+1,date.length); 
	else
		return date.substring(date.lastIndexOf('/')+1,date.length); 
}


function isFirstBeforeSecond(dt1, dt2){	
	// In IE dont add 1900
	// In Netscape add 1900
		date1 = new Date(getyear(dt1),getmonth(dt1)-1,getdate(dt1));
		date2 = new Date(getyear(dt2),getmonth(dt2)-1,getdate(dt2));
		
		if(date1.getYear()+1900<date2.getYear()+1900){
			return true;
		}
		
		if(date1.getYear()+1900==date2.getYear()+1900){
			
			if(date1.getMonth()+1<date2.getMonth()+1){
				return true;
			}
			
			if(date1.getMonth()+1==date2.getMonth()+1){
				if(date1.getDate()<=date2.getDate()){
					return true;
				}
				else{
					return false;
				}
			}
			else{
			
				return false;
			}
		}
		else{
			return false;
		}
	
}//end fun